<%@ page language="java" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8"%>
<%@ page import="dao.Yunjia"%>
<%@ page import="dao.User"%>
<%@ page import="dao.Address"%>
<%@ page import="service.*"%>
<%@ page import="java.util.*"%>
<%
String path = request.getContextPath();
String basePath = request.getScheme()+"://"+request.getServerName()+":"+request.getServerPort()+path+"/";

Yunjia yunjia=(Yunjia)request.getAttribute("yunjiaObj");
User user=(User)request.getSession().getAttribute("SESSION_USER");
if(user==null) {
	request.setAttribute("message","未登录");
	request.getRequestDispatcher("error.jsp").forward(request,response);
	return;
}
if(yunjia==null) {
	request.setAttribute("message","此条运价不存在！！");
	//response.sendRedirect("error.jsp");
	request.getRequestDispatcher("error.jsp").forward(request,response);
	return;
}
String userOrderVip=user.getOrdervip();
String temp="";
temp=yunjia.getYunshumode();
if(temp.toLowerCase().equals("ship"))		temp="海运";
else if(temp.toLowerCase().equals("car"))	temp="陆运";
else if(temp.toLowerCase().equals("plane"))	temp="空运";
else if(temp.toLowerCase().equals("train"))	temp="铁路";
yunjia.setYunshumode(temp);

String baseprice1=yunjia.getBaseprice1().toString();
String baseprice2=yunjia.getBaseprice2().toString();
String baseprice3=yunjia.getBaseprice3().toString();
String baseprice4=yunjia.getBaseprice4().toString();
String baseprice5=yunjia.getBaseprice5().toString();
if(userOrderVip==null || userOrderVip.equals("no")) {
	baseprice1="";
	baseprice2="";
	baseprice3="";
	baseprice4="";
	baseprice5="";
}
%>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<base href="<%=basePath%>">
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<link href="css/frame.css" rel="stylesheet" type="text/css" />
<title>测试框架</title>
<meta http-equiv="pragma" content="no-cache">
<meta http-equiv="cache-control" content="no-cache">


</head>
<body>

<!-- 页头 左边栏 -->
<%@ include file="/common/header.jsp" %>
<%@ include file="/common/left-nav.jsp" %>
<script>setLeftFrame(3,2);</script>

<!-- 此处添加本页代码 -->
<div class="mainBlock">

	<table width="80%" height="750px" cellspacing="2px" cellpadding="0"  style="text-align:center;margin:auto;word-wrap:break-word;" border=1>
			<tr><th colspan=4>运价明细</th></tr>
			<tr><td width="10%">运价编号</td><td colspan="3"><%=yunjia.getYunjiacode() %></td></tr>
			<tr>
				<td width="10%">运输类型</td><td width="40%"> <%=yunjia.getYunshumode() %></td>
				<td width="10%">承运商</td><td width="40%"><%=user.getUserfullname() %></td>
			</tr>
			<tr>
				<td>装 运 地</td><td><%=yunjia.getAddressByStartaddressid().getFullcninfo() %></td>
				<td>目 的 地</td><td><%=yunjia.getAddressByEndaddressid().getFullcninfo() %></td>
			</tr>
			<tr height="30%">
				<td >详细地址</td><td ><%=yunjia.getStartaddr6() %></td>
				<td >详细地址</td><td ><%=yunjia.getEndaddr6() %></td>
			</tr>
			<tr>
				<td >运输时间</td><td><%=yunjia.getTimecost() %></td>
				<td >承运能力</td><td><%=yunjia.getPower() %></td>
			</tr>
			<tr>
				<td >提交日期</td><td><%=yunjia.getSubmitdate().toString().substring(0,19) %></td>
				<td >截止日期</td><td><%=yunjia.getDeadline().toString().substring(0,19) %></td>
			</tr>
			<tr>
				<td >是否特价</td><td><%=yunjia.getTejia() %></td>
			</tr>
			<tr height="30%" align="left">	
				<td >运价录入</td>
				<td>
					<%=yunjia.getBizhong1()+" : "+yunjia.getPrice1()+" ("+baseprice1+") "+" / "+yunjia.getYunshuunit1() %>
					
					<%if(yunjia.getPrice2()!=null && yunjia.getPrice2()!=0) {%>
					<%="<br/>"+yunjia.getBizhong2()+" : "+yunjia.getPrice2()+" ("+baseprice2+") "+" / "+yunjia.getYunshuunit2() %>
					<%} %>
					
					<%if(yunjia.getPrice3()!=null && yunjia.getPrice3()!=0) {%>
					<%="<br/>"+yunjia.getBizhong3()+" : "+yunjia.getPrice3()+" ("+baseprice3+") "+" / "+yunjia.getYunshuunit3() %>
					<%} %>
					
					<%if(yunjia.getPrice4()!=null && yunjia.getPrice4()!=0) {%>
					<%="<br/>"+yunjia.getBizhong4()+" : "+yunjia.getPrice4()+" ("+baseprice4+") "+" / "+yunjia.getYunshuunit4() %>
					<%} %>
					
					<%if(yunjia.getPrice5()!=null && yunjia.getPrice5()!=0) {%>
					<%="<br/>"+yunjia.getBizhong5()+" : "+yunjia.getPrice5()+" ("+baseprice5+") "+" / "+yunjia.getYunshuunit5() %>
					<%} %>
				</td>
				<td >其他信息</td><td><%=yunjia.getYunjiainfo() %></td>
			</tr>
			<tr>
				<td >审核状态</td>
				<td colspan="3">
				<%String yunjiaStatus=yunjia.getYunjiastatus();
				  if(yunjiaStatus.toLowerCase().equals("pending")){%>
				  <%="审核中" %>
				  <%} else if(yunjiaStatus.toLowerCase().equals("approved")) {%>
				  <%="通过" %>
				  <%} else if(yunjiaStatus.toLowerCase().equals("deny")) {%>
				  <%="未通过" %>
				  <%} %>
				</td>
			</tr>
			<%if(yunjia.getYunjiastatus().toLowerCase().equals("deny")) {%>
			<tr><td colspan="4">
				<input type="button" value="删除本条" onClick="if(confirm('是否确认删除'))	window.location='yunjiaIdDelOwn.do?yunjiaID=<%=yunjia.getYunjiaid() %>';">
			</td></tr>
			<%} %>
	</table>
	
</div>

<!-- 页脚 -->
<%@ include file="/common/footer.jsp" %>
</body>
</html>